package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.blockhander.MonitorBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/monitor")
public class MonitorController {
    @SentinelResource(value = "helloResource",
            blockHandler = "helloBlockHandler",
            blockHandlerClass = MonitorBlockHandler.class)
    @GetMapping("/hello")
    public String hello(){
        return "hello sentinel";
    }

    @GetMapping("/hello2")
    public String hello2(){
        return "hello sentinel2";
    }
}
